{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">用户游戏管理</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <form class="layui-form layui-form-pane" action="{:url('admin/usergame/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">用户名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="userName" value="{$userName}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">用户手机</label>
                        <div class="layui-input-inline">
                            <input type="text" name="userPhone" value="{$userPhone}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">游戏名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="gameName" value="{$gameName}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>
                <form action="" method="post" class="ajax-form">
                <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('admin/usergame/delete')}">删除</button>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                        <th style="width: 30px;">ID</th>
                        <th>用户ID</th>
                        <th>用户名称</th>
                        <th>用户手机</th>
                        <th>游戏ID</th>
                        <th>游戏名称</th>
                        <th>游戏时间</th>
                        <th>是否中奖</th>
                        <th>中奖纪录</th>
                        <th>处理结果</th>
                        <th>处理时间</th>
                        <th>处理人</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="usergame_list" item="vo"}
                    <tr>
                        <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.userID}</td>
                        {foreach $user_list as $ul}
                            {if $ul.id == $vo.userID}
                                <td>{$ul.name}</td>
                                <td>{$ul.phone}</td>
                            {/if}
                        {/foreach}
                        <td>{$vo.gameID}</td>
                        <td>{$vo.gameName}</td>
                        <td>{$vo.gameDate}</td>
                        <td>{if $vo.gameWin==1}中奖{else /}-----{/if}</td>
                        <td>{if $vo.gameWin==1 and empty($vo.gameRecord)==false }{$vo.gameRecord}{else /}-----{/if}</td>
                        <td>
                            {if $vo.gameWin==1}
                                {if $vo.manage==0}
                                    <!-- <i style="font-style: normal;color:#e90d24;">未领取</i> -->
                                    <a href="{:url('admin/usergame/dvjd',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">兑奖</a>
                                {else /}
                                    <i style="font-style: normal;color:#4caf50;">已领取</i>
                                {/if}
                            {else /}
                                -----
                            {/if}
                        </td>
                        <td>
                            {if $vo.manage==1}
                                {$vo.disposeDate}
                            {else /}
                                -----
                            {/if}
                        </td>
                        <td>
                            {if $vo.manage==1}
                                {$vo.disposeMan}
                            {else /}
                                -----
                            {/if}
                        </td>
                        <td>
                            <a href="{:url('admin/usergame/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$usergame_list->render()}
                </form>
            </div>
        </div>
    </div>
</div>
{/block}